# Contributor: knuxify <knuxify@gmail.com>
# Contributor: Maxim Karasev <begs@disroot.org>
# Maintainer: knuxify <knuxify@gmail.com>
pkgname=chafa
pkgver=1.14.0
pkgrel=0
pkgdesc="Terminal graphics for the 21st century"
url="https://hpjansson.org/chafa"
arch="all"
license="LGPL-3.0-or-later"
makedepends="glib-dev freetype-dev libjpeg-turbo-dev tiff-dev librsvg-dev libwebp-dev"
subpackages="$pkgname-libs $pkgname-dev $pkgname-doc"
source="https://github.com/hpjansson/chafa/releases/download/$pkgver/chafa-$pkgver.tar.xz"

build() {
	# https://github.com/hpjansson/chafa/issues/152
	export LDFLAGS="$LDFLAGS -lwebp"

	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--disable-gtk-doc \
		--without-imagemagick
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
f205bf5b8e31b05a227484a2445eb1a06b0b3abe2f27483b899340d89a22c0cd188e9b56a4217e09ac313af6e71fa75b5a480b66e85464422fd46049ec480522  chafa-1.14.0.tar.xz
"
